<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>系统基本参数</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
	<style type="text/css">
		.layui-table td, .layui-table th{ text-align: center; }
		.layui-table td{ padding:5px; }
	</style>
</head>
<body class="childrenBody">
	<form class="layui-form">
		<table class="layui-table">
			<colgroup>
				<col width="20%">
				<col width="40%">
				<col width="40%">
		    </colgroup>
		    <thead>
		    	<tr>
		    		<th>变量名</th>
		    		<th>参数值</th>
		    		<th>说明</th>
		    	</tr>
		    </thead>
		    <tbody>
		    	<s:iterator value="sysInfoList" var="sysinfo" status="num">
		    	<tr>
		    		<input type="hidden" name="id<s:property value="%{#num.count}" />" value="<s:property value="#sysinfo.id" />"/>
		    		<td><input type="text" class="layui-input record" name="name<s:property value="%{#num.count}" />"  placeholder="请填写该信息" value="<s:property value="#sysinfo.name" />"></td>
		    		<td><input type="text" class="layui-input record" name="value<s:property value="%{#num.count}" />"  placeholder="请填写该信息" value="<s:property value="#sysinfo.value" />"></td>
		    		<td><input type="text" class="layui-input record" name="note<s:property value="%{#num.count}" />" placeholder="请填写该信息" value="<s:property value="#sysinfo.note" />"></td>
		    	</tr>
		    	</s:iterator>
		    </tbody>
		</table>
		<div class="layui-form-item" style="text-align: right;">
			<div class="layui-input-block">
				<button class="layui-btn" lay-submit="" lay-filter="systemParameter">立即提交</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		    </div>
		</div>
	</form>
	<script type="text/javascript" src="../../layui/layui.js"></script>
<script type="text/javascript">
	layui.config({
		base : "js/"
	}).use(['form','layer','jquery'],function(){
		var form = layui.form(),
			layer = parent.layer === undefined ? layui.layer : parent.layer,
			laypage = layui.laypage,
			$ = layui.jquery;
		form.on("submit(systemParameter)",function(data){
			$.post(<%="'"+request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/link_editSysInfo'"%>,data.field).done(function(){
				var index = top.layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.8});
	            layer.close(index);
				layer.msg("系统基本参数修改成功！");
				
			}).fail(function(){
				layer.msg("修改失败！");
			})
	 		return false;
		})
		})
</script>
</body>
</html>